﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="MusicCollectionTabControlStyle" TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="TabStripPlacement" Value="Left"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="140"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TabPanel Name="HeaderPanel"
                                Panel.ZIndex="1" 
                                Margin="0,36,0,0" 
                                IsItemsHost="True"
                                Background="Transparent"/>
                        <Border Name="Border" Grid.Column="1" Background="{StaticResource TabContainerBackgroundBrush}" 
                            BorderBrush="{StaticResource PassiveGenericBorderBrush}" BorderThickness="0" CornerRadius="0">
                            <ContentPresenter Name="PART_SelectedContentHost" Margin="0" ContentSource="SelectedContent"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type TabItem}">
                    <Setter Property="Foreground" Value="{StaticResource PassiveTextBrush}"/>
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="{StaticResource TabControlBorderBrush}"/>
                    <Setter Property="Margin" Value="0,0,0,0"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TabItem}">
                                <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
                                    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Background="{TemplateBinding Background}" Margin="0,0,0,-1" Height="Auto">
                                        <ContentPresenter x:Name="contentPresenter"
                                                          ContentTemplate="{TemplateBinding HeaderTemplate}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header"
                                                          Focusable="False" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                          HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,9,20,8">
                                            <ContentPresenter.Content>
                                                <TextBlock x:Name="contentText" FontWeight="Light" FontSize="14"  Text="{TemplateBinding Header}"></TextBlock>
                                            </ContentPresenter.Content>
                                        </ContentPresenter>
                                    </Border>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="border" Property="Background" Value="{StaticResource MouseOverBackgroundBrush}"/>

                                    </Trigger>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="Panel.ZIndex" Value="1"/>
                                        <Setter TargetName="border" Property="Background" Value="{StaticResource SelectedTabHeaderBackgroundBrush}"/>
                                        <Setter TargetName="border" Property="Margin" Value="0,0,-1,-1"/>
                                        <Setter TargetName="contentText" Property="Foreground" Value="{StaticResource SelectedTabHeaderTextBrush}"/>
                                        <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource SelectedTabHeaderBorderBrush}"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>